package com.sikaryofficial.workbench.domain.dto.req.membership;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import javax.validation.constraints.DecimalMax;
import javax.validation.constraints.DecimalMin;
import javax.validation.constraints.Digits;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;

/**
 * @author : wuweihong
 * @desc : 会员激励政策请求实体
 * @date : 2024-10-20
 */

@Getter
@Setter
@ToString
@ApiModel(value = "会员激励保存Req入参对象", description = "会员激励保存Req入参对象")
public class MembershipPolicySaveReq implements Serializable {

	private static final long serialVersionUID = 1L;

	/**
	 * 会员激励政策id
	 */
	@ApiModelProperty(value = "会员激励政策id")
	private Long membershipPolicyId;

	/**
	 * 标题
	 */
	@ApiModelProperty(value = "标题")
	@NotNull(message = "标题不允许为空")
	private String title;

	/**
	 * 状态
	 */
	@ApiModelProperty(value = "状态")
	private Integer status;

	/**
	 * 最低金额
	 */
	@ApiModelProperty(value = "最低金额")
	@NotNull(message = "最低金额不能为空")
	@Min(value = 0, message = "最小值必须大于0")
	private BigDecimal minAmount;

	/**
	 * 最高金额
	 */
	@ApiModelProperty(value = "最高金额")
	private BigDecimal maxAmount;

	/**
	 * 折扣比例
	 */
	@ApiModelProperty(value = "折扣")
	@NotNull(message = "折扣比例不能为空")
	@DecimalMin(value = "0.00", message = "折扣比例必须大于0")
	@DecimalMax(value = "100.00", message = "折扣比例不能超过100")
	@Digits(integer = 3, fraction = 2, message = "折扣小数位只支持2位")
	private BigDecimal discount;

	/**
	 * 是否指定用户
	 */
	@ApiModelProperty(value = "是否指定用户")
	private Boolean hasSpecificUser;

	/**
	 * 指定用户列表
	 */
	@ApiModelProperty(value = "指定用户列表")
	private List<MembershipRelationReq> users;

}
